/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.fiap.ducksim;

/**
 *
 * @author osvaldoandrade
 */
public abstract class Duck {
    
    private FlyBehavior flyBehavior;
    private QuackBehavior quackBehavior;

    public void setFlyBehavior(FlyBehavior flyBehavior) {
	this.flyBehavior = flyBehavior;
    }

    public void setQuackBehavior(QuackBehavior quackBehavior) {
	this.quackBehavior = quackBehavior;
    }
    
    public final void swin() {
	System.out.println("Estou nadando");
    }
    
    public final void performQuack() {
	this.quackBehavior.quack();
    }
    
    public final void performFly() {
	this.flyBehavior.fly();
    }
    
    public abstract void display();
    
    public static void main(String[] args) {
	Duck duck = new NoFlyDuck();
	duck.performFly();
	duck.performQuack();
	duck.swin();
	duck.display();
    }
    
}
